<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2024/12/21
  Time: 下午5:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.*, java.util.UUID" %>
<%@ page import="bean.DB" %>
<%@ page import="bean.ResponseUtils" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员注册</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }

        .container {
            width: 60%;
            margin: 50px auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
        }

        .input-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        .submit-btn {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }

        .submit-btn:hover {
            background-color: #45a049;
        }

        .error-message {
            color: red;
            font-size: 14px;
        }

        .success-message {
            color: green;
            font-size: 14px;
        }
        /* 新增的取消按钮样式类 */
        .cancel-button {
            width: 80px;
            height: 40px;
            margin-top: 10px;
            margin-left: 10px;
        }
    </style>
</head>
<body>

<%
    String successMessage = request.getParameter("success");
    String errorMessage = request.getParameter("error");

    if (successMessage != null) {
%>
<p class="success-message"><%= successMessage %></p>
<%
    }

    if (errorMessage != null) {
%>
<p class="error-message"><%= errorMessage %></p>
<%
    }
%>

<div class="container">

    <h2>成为管理员</h2>

    <form action="./managerRegServlet" method="post">
        <div class="input-group">
            <label for="username">账户：</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="input-group">
            <label for="password">密码：</label>
            <input type="password" id="password" name="password" required>
        </div>
        <div class="input-group">
            <label for="confirmPassword">确认密码：</label>
            <input type="password" id="confirmPassword" name="confirmPassword" required>
        </div>
        <button type="submit" class="submit-btn">注册</button>
        <button type="submit" class="submit-btn" onclick="goToAnotherPage()">取消</button>
    </form>
</div>

</body>
<script>
    function goToAnotherPage() {
        // 修改这里的地址为你实际要跳转的页面地址
        window.location.href = "userinfo.jsp";
    }
</script>
</html>
